Ratcheting for master alignment of a teleoperated minimally invasive surgical instrument

ABSTRACT

A minimally-invasive surgical system includes a slave surgical instrument having a slave surgical instrument tip and a master grip. The slave surgical instrument tip has an alignment in a common frame of reference and the master grip, which is coupled to the slave surgical instrument, has an alignment in the common frame of reference. An alignment error, in the common frame of reference, is a difference in alignment between the alignment of the slave surgical instrument tip and the alignment of the master grip. A ratcheting system (i) coupled to the master grip to receive the alignment of the master grip and (ii) coupled to the slave surgical instrument, to control motion of the slave by continuously reducing the alignment error, as the master grip moves, without autonomous motion of the slave surgical instrument tip and without autonomous motion of the master grip.

This application is a continuation of U.S. patent application Ser. No.14/534,526 (filed 6 Nov. 2014), which is a continuation of U.S. patentapplication Ser. No. 13/839,438 (filed 15 Mar. 2013) (now U.S. Pat. No.8,903,549 B2), which is a continuation of U.S. patent application Ser.No. 12/495,213 (filed 30 Jun. 2009) (now U.S. Pat. No. 8,423,186 B2),the full disclosures of which are incorporated by reference herein forall purposes.

BACKGROUND

1. Field of Invention

Aspects of this invention are related to teleoperated minimally-invasivesurgical systems, and more particularly are related to controllingorientation of master and slave surgical instrument tips in ateleoperated minimally-invasive surgical system.

2. Art

The da Vinci® surgical system, manufactured by Intuitive Surgical, Inc.,Sunnyvale, Calif., is a minimally-invasive, teleoperated robotic systemthat offers patients many benefits, such as reduced trauma to the body,faster recovery and shorter hospital stay. One component of the daVinci® Surgical System is a master tool manipulator that a surgeon usesto manipulate a surgical instrument, referred to as a slave surgicalinstrument.

The master grip of the master tool manipulator is specially designed tobe both ergonomic and intuitive for controlling the slave surgicalinstrument. The surgeon holds the master grip in a particular way usinghis/her forefinger and thumb, so that targeting and grasping involvesintuitive pointing and pinching motions.

To enable intuitive control of the slave surgical instrument, the mastergrip must be aligned in orientation with the slave surgical instrumenttip in the view reference frame of the stereoscopic viewer. The motionsof the slave surgical instrument tip follow master motions viateleoperation and are consistent in both directions of motion as well asabsolute orientation. If orientation alignment is not achieved, theslave surgical instrument tip may still rotate in the desired direction,but the slave surgical instrument tip neither points in the sameabsolute direction nor rolls along the same axis as the surgeon ispointing.

The master tool manipulator uses motors in a gimbal assembly to activelyalign the orientation axes of the master grip with the associated slavesurgical instrument tip in view coordinates. This alignment happensautomatically before the surgeon engages teleoperation. Moreover, thesystem automatically preserves this alignment during manipulation of thecamera or instrument outer axes.

Specifically, when entering following on the da Vinci® surgical system,the master grip must be aligned with the orientation of the slavesurgical instrument tip before the da Vinci® surgical system operatesproperly in following. The present system performs a master alignmentwhenever the system transitions from a mode where this orientationalignment may have been compromised (after a tool change, camera clutch,slave clutch, swapping of arms in a 4th arm system etc.).

A master alignment calculates a set of master wrist joint angles thatcause the orientation of the master grip to match the orientation of theslave surgical instrument tip, without changing the master gripposition. The master wrist joints are then commanded to match thecalculated angles using the motors.

The da Vinci® surgical system checks that the master and slaveorientations match before allowing the user to enter following. If theorientations don't match (presumably because the user has over poweredthe master and not allowed the master to complete the alignment) awarning message is displayed and the master alignment is attemptedagain. This often slows down the surgeon's entry into following andrequires a powered master tool manipulator with motors in the gimbalassembly to move master wrist joints into the proper orientation.

SUMMARY OF THE INVENTION

A minimally-invasive surgical system includes a slave surgicalinstrument having a slave surgical instrument tip and a master grip. Themaster grip is coupled to the slave surgical instrument tip by ateleoperation servo control system. In one aspect, a ratcheting system,within the teleloperation servo control system, seamlessly andcontinuously improves the alignment, in a common coordinate frame ofreference, of the master grip with respect to the slave surgicalinstrument tip as the master grip is moved.

The ratcheting system results in intuitive alignment between the mastergrip and the slave surgical instrument tip. Also, the ratcheting systemprovides a direct association between what the surgeon is doing,manipulating the master grip, and what the surgeon is seeing at asurgeon's console, movement of the slave surgical instrument tip in thedisplay. This is achieved without the delays associated with theconventional powered alignments before following could be entered. Also,the ratcheting system, in one aspect, eliminates the need for thepowered master grip and permits use of lower cost readily availablecomponents as the master grip.

In one aspect, the slave surgical instrument tip and the master griphave Cartesian position components and orientation components in acommon coordinate reference frame. The ratcheting system can achievealignment for all components, a subset of components, e.g., theorientation components or the Cartesian components, or in acomponent-wise fashion for a particular set of components.

A ratcheting system, in the teleoperation servo control system, is (i)coupled to the master grip to receive the alignment of the master gripin a common coordinate frame, and (ii) coupled to the slave surgicalinstrument. The ratcheting system controls the motion of the slave bycontinuously reducing the alignment error in the common coordinateframe, as the master grip moves. This is done without autonomous motionof the slave surgical instrument tip and without autonomous motion ofthe master grip.

In one aspect, the alignment error in the common coordinate frame is anorientation error. The orientation error comprises an angle. In oneaspect, the angle is an angle θ_(e) defined as:θ_(e)=cos⁻¹[0.5*(R _(Δ11) +R _(Δ22) +R _(Δ33)−1)],where R_(Δ11), R_(Δ22), R_(Δ33) are diagonal elements of a relativerotation matrix R_(Δ). In another aspect, the angle is one Euler anglein a set of Euler angles.

In another aspect, the ratcheting system includes an introduce controlloop error controller that introduces a control system error in thealignments of the slave surgical instrument tip and the master grip inthe common frame of reference. For example, an angular velocity of theslave surgical instrument is penalized based upon an amount ofmisalignment in the common reference frame between the slave surgicalinstrument tip and the master grip. In still another aspect, theratcheting system includes a roll-joint limit controller for determiningwhether motion of the slave surgical instrument has reached a jointlimit and constraining motion of the slave surgical instrument tip uponreaching the joint limit. In still yet another aspect, the ratchetingsystem includes multiple orientation solutions, a best orientationcontroller selects one solution from the multiple orientation solutionsthat is closest to the orientation of the master grip.

A method using the above minimally surgical system includes controllingmotion of a slave surgical instrument tip in the minimally-invasivesurgical system with motion of a master grip in the minimally-invasivesurgical system. In this method, a ratcheting system in theminimally-invasive surgical system receives an alignment of the slavesurgical instrument tip and an alignment of the master grip, both in acommon frame of reference. The ratcheting system ratchets the alignmentof the slave surgical instrument tip to the alignment of the master gripby continuously reducing an alignment error between the alignments, asthe master grip moves, without autonomous motion of the slave surgicalinstrument tip and without autonomous motion of the master grip.

In one aspect, the ratcheting includes moving the slave surgicalinstrument tip and the master grip in a same relative way uponengagement of following by the minimally-invasive surgical systemirrespective of the alignments in the common reference frame. Theratcheting also includes bleeding off the alignment error in the commonframe of reference by using a new alignment error when the motion of themaster grip reduces the alignment error in the common reference frame,and by using a current alignment error in the common reference framewhen the motion of the master grip does not reduces the alignment errorthereby continuously reducing the alignment error between the alignmentsin the common reference frame.

The ratcheting system also generates a new alignment for the slavesurgical instrument using the new alignment error, and sends a commandto the slave surgical instrument based on the new alignment.

In another aspect, the ratcheting system introduces a control errorbetween the slave surgical instrument alignment and the master gripalignment. The introduction of a control error further includespenalizing a commanded angular velocity for the slave surgicalinstrument tip based on the current alignment error.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagrammatic view of a minimally-invasive surgical robotwhich includes a teleoperation servo control system with a ratchetingsystem.

FIG. 2A is diagrammatic view of parts of the surgeon's console of FIG. 1for a minimally-invasive surgical robot of FIG. 1.

FIG. 2B illustrates the orientations of the master grip and the slavegrip and rotation angle error θ_(e) between the two orientations.

FIG. 2C illustrates the orientations of the master grip and the slavegrip and the orientation error has been decomposed into a set of Eulerangles.

FIG. 3A is a process flow diagram for the ratcheting system.

FIG. 3B is a block diagram of a control system including the modulesused to implement the ratcheting system.

FIG. 4A is a process flow diagram for one aspect of the ratchetalignment process of FIG. 3A.

FIG. 4B is a block diagram of a control system including the modulesused to implement the ratchet alignment process.

FIG. 5A is a process flow diagram for another aspect of the ratchetalignment process of FIG. 3A.

FIG. 5B is an illustration of an angular velocity penalty profile.

FIG. 6A is a process flow diagram for another aspect of the ratchetingsystem.

FIG. 6B is a block diagram of control system including the modules usedto implement the ratcheting system of FIG. 6A.

FIG. 7 is an illustration of corner-case handling of roll-joint limitsfor the slave surgical instrument tip.

In the drawings, the first digit of a figure number indicates the figurein which the element with that figure number first appeared.

DETAILED DESCRIPTION

Aspects of this invention replace the powered master tool manipulator,such as that used in the da Vinci® Surgical Robot System manufactured byIntuitive Surgical, Inc. of Sunnyvale, Calif. with an unpowered mastertool manipulator that includes at least one master grip. Inminimally-invasive surgical system 100, a surgeon, at a console 114,grasps a master grip (not shown) between the thumb and forefinger sothat targeting and grasping still involves intuitive pointing andpinching motions. The motion of the master grip is used by controlsystem 150, as described more completely below, to move an end-effectorof slave surgical instrument 112.

Unlike the conventional system that required the surgeon to wait untilthe alignment of the master grip and the slave surgical instrumentend-effector, in a common frame of reference, were positioned so thatfollowing could be entered, a ratcheting system 130, within ateleoperation servo control system 160 of control system 150, isactivated when the surgeon starts to move the master grip. Irrespectiveof the alignment between the master grip and the end-effector of slavesurgical instrument 112 in the common frame of reference, teleoperationservo control system 160 enters following between the master grip andthe surgical instrument end-effector, sometimes called a slave surgicalinstrument tip, and activates ratcheting system 130.

Ratcheting system 130 seamlessly and continuously improves the alignmentof the master grip with respect to the slave surgical instrument tip, inthe common frame of reference, as the master grip is moved. Ratchetingsystem 130 ratchets the movement of the slave surgical instrument tip tocontinuously and seamlessly reduce any alignment error, in the commonframe of reference, between the slave surgical instrument tip and themaster grip. Ratcheting system 130 achieves the alignment withoutautonomous motion of either the master grip, or the slave surgicalinstrument tip.

Ratcheting system 130 results in intuitive alignment between the mastergrip and the slave surgical instrument tip as viewed by the surgeon.Also, ratcheting system 130 provides a direct association between whatthe surgeon is doing, manipulating the master grip, and what the surgeonis seeing at console 114, movement of the slave surgical instrument tipin the display. This is achieved without the delays associated with theconventional powered alignments before following could be entered. Also,ratcheting system 130 eliminates the need for the powered master gripand permits use of lower cost readily available components as the mastergrip.

Console 114 (FIGS. 1 and 2A) includes a master display, which displaysat least a stereoscopic image 210 (FIG. 2A) of a surgical site 103 ofpatient 111. Stereoscopic image 210 typically includes an image 203 ofsurgical site 103, an image 212 of a part of surgical instrument 112,and an image 212T of a tip of slave surgical instrument 112. Console 114also includes one or more foot pedals (Not shown).

Console 114 (FIG. 1) is connected to a control system 150 that is turnis connected to a cart 110, which supports a plurality of robotic armsthat includes robotic arm 113. Slave surgical instrument 112 is held andpositioned by robotic arm 113. While it is not shown in FIG. 1, anendoscope, held by another of the robotic arms, is typically used toprovide image 210.

The surgeon sits comfortably and looks into the master display onconsole 114 throughout, surgery. The surgeon performs a medicalprocedure by manipulating at least master grip 230 (FIG. 2A). Inresponse to master alignment information 132 from master grip 230,teleoperation servo control system 160 in control system 150 (FIG. 1)causes corresponding robotic arm 113 to position slave surgicalinstrument 112 using a slave command 135. Typically, console 114includes at least two master grips and each master grip controls adifferent robotic arm and attached surgical instrument. Herein a singlemaster grip 230 is considered. In view of this description, ratchetingsystem 130 can be implemented for any desired number of master grips.

The master display is positioned on console 114 (FIG. 1) near thesurgeon's hands so that image 210 (FIG. 2A), which is seen in the masterdisplay, is oriented so that the surgeon feels that she or he isactually looking directly down onto surgical site 103. Image 212 of tool112 appears to be located substantially where the surgeon's hands arelocated and oriented substantially as the surgeon would expect tool 112to be based on the position of her/his hand. However, the surgeon cannotsee the position or orientation of master grip 230 while viewing image210.

The real-time image from the endoscope is projected into perspectiveimage 210 such that the surgeon can manipulate a surgical instrumentend-effector of tool 112, through its associated master grip 230, as ifviewing the workspace in substantially true presence. By true presence,it is meant that the presentation of an image is a true perspectiveimage simulating the viewpoint of an operator that is physicallymanipulating the surgical instrument. Thus, control system 150transforms the coordinates of surgical instrument 112 to a perceivedposition so that the perspective image is the image that the surgeonwould see if the endoscope were looking directly at surgical tool 112from the surgeon's eye-level during an open cavity procedure.

Control system 150 performs various functions in system 100. Controlsystem 150 receives the images from an endoscope and generates thestereoscopic image that the surgeon sees. In a conventional manner,control system 150 maps the slave alignment with respect to tip of theendoscope and maps the master alignment with respect to an aspect of thesurgeon into the common frame of reference, sometimes called commonreference frame, which is used by ratcheting system 130. See forexample, U.S. Pat. No. 6,424,885, entitled “Camera Referenced Control ina Minimally-invasive Surgical Apparatus,” of Niemeyer et al. issued onJul. 23, 2002, which is incorporated herein by reference in itsentirety.

Control system 150 uses teleoperation servo control system 160 totranslate and to transfer the mechanical motion of master grip 230 to anassociated robotic arm 113 through control commands 135 so that thesurgeon can effectively manipulate slave surgical instrument 112. Thefunctions performed by teleoperation servo control system 160 areequivalent to the conventional functions when considered in conjunctionwith ratcheting system 130 that is also included in control system 150.

The number of surgical tools used at one time and consequently, thenumber of robotic arms being used in system 100 generally depends on themedical procedure to be performed and the space constraints within theoperating room, among other factors. If it is necessary to change one ormore of the tools being used during a procedure, an assistant may removethe tool no longer being used from its robot arm, and replace the toolwith another tool from a tray in the operating room.

Although described as a control system 150, it is to be appreciated thatcontrol system 150 may be implemented in practice by any combination ofhardware, software that is executed on a processor, and firmware. Also,its functions, as described herein, may be performed by one unit, ordivided up among different components, each of which may be implementedin turn by any combination of hardware, software that is executed on aprocessor, and firmware. When divided up among different components, thecomponents may be centralized in one location or distributed acrosssystem 100 for distributed processing purposes.

When there are only two master grips in system 100, and when the surgeonwants to control movement of a slave surgical instrument different fromthe two slave surgical instruments coupled to the two master grips, thesurgeon may lock one or both of the two slave surgical instruments inplace. The surgeon then associates one or both of the master grips withother slave surgical instruments held by other of the robotic arms andratcheting system 130 becomes active with respect to those instruments.

Master grip 230 provides an alignment that is mapped into the commonframe of reference, but is not powered, or at least does not include apowered wrist. However, the features of master grip 230, as describedmore completely below, can be used with a master grip that includes apowered wrist. As used herein, a powered wrist means a wrist thatincludes at least one motor to control the positioning of the wrist. Themotor can be used to compensate for gravity and friction and to providerange of motion force-feedback, but any powered alignment capability isturned-off.

Master grip 230 includes two levers 231, 232, which the surgeontypically grasps between the thumb and forefinger. As the surgeon movesmaster grip 230, in one aspect, a master grip alignment 132 is providedto ratcheting system 130 in the common reference frame (See FIG. 2B forexample). In this aspect, slave surgical instrument tip 212T has a slavealignment and ratcheting system 130 also receives this slave alignmentmapped into the common reference frame. The two alignments used byratcheting system 130 are in a common reference frame.

Thus, in one aspect of method 300 (FIG. 3A) is performed by ratchetingsystem 130. In this aspect, ratcheting system 130 includes a ratchetingsystem module 370 (FIG. 3B) that in turn includes a receive alignmentmodule 371 and a ratchet alignment module 372.

A receive new alignment of master and slave operation 310, associatedwith receive orientation module 371, receives the master grip alignmentand slave surgical instrument tip alignment in the common frame ofreference. Ratcheting system 130 waits in following check operation 320until following is initiated. Following check operation 320 should notbe interpreted as requiring continuous polling, but rather simplyinterpreted as nothing is done with respect to the alignments in thecommon frame of reference until following is initiated.

Check operation 320 is used for illustration only and should not beviewed as limiting. The particular technique used to determine whetherfollowing is initiated could be based on an interrupt, an event, aparticular flag or bit changing state, etc.

Upon engagement of following between master grip 230 and slave surgicalinstrument tip 212T, ratchet alignment process 330, which is associatedwith ratchet alignment module 372, generates commands that result inslave surgical instrument tip 212T moving in the same relative way asmaster grip 230 is moved irrespective of any alignment error in thecommon frame of reference between master grip 230 and slave surgicalinstrument tip 212T.

Note that for convenience, slave surgical instrument tip 212T is used inthis description, as this is what the surgeon sees moving. The movementof this image corresponds directly to the movement of the slave surgicalinstrument tip itself. One knowledgeable in the field understands thatmovement of the image is a direct result of movement of the tip itselfby the robot arm in response to a command from control system 150, asdescribed herein.

As both master grip 230 and slave surgical instrument tip 212T move,ratchet alignment process 330 bleeds off any alignment error in thecommon reference frame between master grip 230 and slave surgicalinstrument tip 212T. For example, when the surgeon moves master grip 230in a way that reduces the alignment error, ratchet alignment process 330uses the reduced alignment error in the following between master grip230 and slave surgical instrument tip 212T. Conversely, when the surgeonmoves master grip 230 in a way that increases the alignment error,ratchet alignment process 330 uses the current alignment error, and notthe increased alignment error, in the following between master grip 230and slave surgical instrument tip 212T.

Thus, ratchet alignment process 330 seamlessly and continuously improvesthe absolute alignment of master grip 230 with respect to slave surgicalinstrument tip 212T. Ratchet alignment process 330 achieves thecontinuous improvement in absolute alignment without causing autonomousmotion of either master grip 230 or slave surgical instrument tip 212T.

Ratcheting system 130 can ratchet an alignment error in the commonreference frame that is either a position error or an orientation error.In the following examples, ratcheting of an orientation error in acommon frame of reference is considered. However, the orientation errorexamples are illustrative only and are not intended to be limiting tothe specific aspects described. In view of this disclosure, oneknowledgeable in the field can apply the same principles to ratchet aposition error.

In the following examples, as the surgeon moves master grip 230, in oneaspect, a master grip orientation 235 in the common frame of referenceis provided to ratcheting system 130. In this aspect, slave surgicalinstrument tip 212T has a slave orientation 225 in the common framereference, which is equivalent to the orientation of the slave surgicalinstrument tip itself. Ratcheting system 130 also receives this slaveorientation in the common frame of reference. In this aspect, the z-axisof master grip 230 is on the roll axis and points away from the hand.The corresponding z-axis on the slave is, for example, along thecenterline of the jaws and indicates where the jaws are pointing.

In one aspect, orientation 235 of master grip 230 in the common frame ofreference is defined in teleoperation servo control system 160 by amaster grip rotation matrix R_(m), which in this example is athree-by-three matrix. Similarly, orientation 225 of slave surgicalinstrument tip 212T in the common frame of reference is defined inteleoperation servo control system 160 by a slave surgical instrumenttip rotation matrix R_(s), which in this example also is athree-by-three matrix. Master grip rotation matrix R_(m) and slavesurgical instrument tip rotation matrix R_(s) are orthonormal rotationmatrices.

With these matrix representations of orientations 235 and 225, theorientation error in the common frame of reference is a relativerotation matrix R_(Δ). Relative rotation matrix R_(Δ) is defined as:R _(Δ) =R _(s) ^(T) *R _(m)  (1)where matrix R_(s) ^(T) is the transpose of slave surgical instrumenttip rotation matrix R_(s). It follows from the definitions of matrixR_(s) ^(T) and matrix R_(m), taken with definition (1) that relativerotation matrix R_(Δ) is a three-by-three matrix:

$R_{\Delta} = \begin{pmatrix}R_{\Delta\; 11} & R_{\Delta\; 12} & R_{\Delta\; 13} \\R_{\Delta\; 21} & R_{\Delta\; 22} & R_{\Delta\; 23} \\R_{\Delta\; 31} & R_{\Delta\; 32} & R_{\Delta\; 33}\end{pmatrix}$When orientation 235 of master grip 230 and orientation 225 of slavesurgical instrument tip 212T are aligned in the common frame ofreference, relative rotation matrix R_(Δ) is an identity matrix, i.e.,diagonal elements R_(Δ11), R_(Δ22), R_(Δ33) have a value of one and allother elements have a value of zero.

With these definitions of master grip rotation matrix R_(m), slavesurgical instrument tip rotation matrix R_(s), and relative rotationmatrix R_(Δ), subsequent master grip orientations are mapped tocorresponding slave orientation commands, in the common frame ofreference, via:R _(s) =R _(m) *R _(Δ) ^(T)  (2)where matrix R_(Δ) ^(T) is the transpose of relative rotation matrixR_(Δ).

As described above, with a current relative rotation matrixR_(Δ-Current) and a new relative rotation matrix R_(Δ-New), a decisionmust be made on which of the two relative rotation matrices to use inthe mapping to the corresponding slave orientation command. New relativerotation matrix R_(Δ-New) is used whenR _(Δ-New) <R _(Δ-Current)

However, it has been recognized that a scalar quantity can be used todetermine which relative rotation matrix to use. Thus, a technique forcomparing multi-dimension matrices is not needed to determine when newrelative rotation matrix R_(Δ-New) is less than current relativerotation matrix R_(Δ-Current).

As illustrate in FIG. 2B, the orientation error between orientation 235of master grip 230 and orientation 225 of slave surgical instrument tip212T, in the common frame of reference, is represented by a scalarrotation angle error θ_(e). Rotation angle error θ_(e) is the anglethrough which slave surgical instrument tip orientation 225 must berotated to coincide with master grip orientation 235 and so representsthe misalignment.

Rotation angle error θ_(e) is defined as:θ_(e)=cos⁻¹[0.5*(R _(Δ11) +R _(Δ22) +R _(Δ33)—1)]  (3)Recall, as described above, when master grip orientation 235 and slavesurgical instrument tip orientation 225 are aligned, diagonal elementsR_(Δ11), R_(Δ22), R_(Δ33) have a value of one. Thus, when the twoorientations are aligned, rotation angle error θ_(e) is zero.

In this aspect, ratchet alignment process 330 for ratcheting system 130is implemented as ratchet orientation process 330A (FIG. 4A) inassociation with a ratcheting system module 470. Ratcheting systemmodule 470 includes a receive orientation module 471 and a ratchetorientation module 472 (FIG. 4B).

Upon entering following, generate new orientation error process 410,which is associated with orientation error generation module 481,accesses master grip rotation matrix R_(m) and slave surgical instrumenttip rotation matrix R_(s).

Next, process 410 uses master grip rotation matrix R_(m) and slavesurgical instrument tip rotation matrix R_(s) to generate a new relativerotation matrix R_(Δ-New) based on definition (1) above. Here, slavesurgical instrument tip rotation matrix R_(s) is the current orientationof slave surgical instrument tip 212T and is stored for example, inslave orientation element 131 in memory 404 (FIG. 4B), while master griprotation matrix R_(m) is a new orientation of master grip 230. Thediagonal elements of new relative rotation matrix R_(Δ-New) are used indefinition (3) above to generate a new rotation angle error θ_(e-New).After generation of new rotation angle error θ_(e-New), process 410transfers to orientation error reduced check operation 420 that isassociated with orientation error comparator module 482 (FIG. 4B).

Orientation error reduced check operation 420 determines whether newrotation angle error θ_(e-New) is less than current rotation angle errora θ_(e-Current), e.g., check operation 420 is implemented as acomparator. If new rotation angle error θ_(e-New) is equal to or greaterthan current rotation angle error θ_(e-Current), check operation 420passes to set orientation operation 440. Conversely, if new rotationangle error θ_(e-New) is less than current rotation angle errorθ_(e-Current), check operation passes processing to set orientationoperation 430.

The use of two set orientation operations 430, 440 is for ease ofillustration only and is not intended to be limiting. A single setorientation operation could be used for the instances in which rotationangle error θ_(e) is reduced, for example. Also, note that in the firstpass through ratchet orientation process 330A, check operation 420 maysimply pass processing to set orientation error operation 430.Alternatively, in initialization, current rotation angle errorθ_(e-Current) can be set to a large value so that new rotation angleerror θ_(e-New) is always less than current rotation angle errorθ_(e-Current) in the first pass. The particular aspect used to handlethe first pass through process 330A is not critical so long as noautonomous motion is introduced.

Set orientation error operation 440 is effectively a no-op, becausecurrent rotation angle error θ_(e-Current) and current relative rotationmatrix R_(Δ-Current) are maintained as the current rotation angle errorand the current relative rotation matrix, respectively. Thus, operation440 can be removed and processing simply transfers from check operation420 directly to generate new slave orientation 450.

Set orientation error operation 430, which is associated with comparatormodule 482, sets current rotation angle error θ_(e-Current) to newrotation angle error θ_(e-New). Operation 430 also sets current relativerotation matrix R_(Δ-Current) to new relative rotation matrix R_(Δ-New)and then transfers to generate new slave orientation operation 450.

Generate new slave orientation 450, which is associated with slavegeneration orientation module 483, first generates a transpose matrixR_(Δ) ^(T) of current relative rotation matrix R_(Δ-Current). Next, anew slave orientation matrix R_(s) is obtained by combining transposematrix R_(Δ) ^(T) and master grip rotation matrix R_(m) according todefinition (2), above. Thus, operation 450 transforms the masterorientation into a slave orientation.

Generate new slave orientation 450 transfers processing to send slaveorientation command operation 460, which is associated with slavecommand generation module 484. Using new slave orientation R_(s),operation 460 sends a command, via slave input/output (I/O) module 403,which results in slave surgical instrument tip 212T being moved. Themovement depends upon which relative rotation matrix R_(Δ) was used inthe current iteration of process 330A.

In process 330A, When the surgeon moves master grip 230 in a way thatreduces the alignment error in the common reference frame between mastergrip 230 and slave surgical instrument tip 212T, e.g., reduces rotationangle error θ_(e), ratchet alignment process 330A (FIG. 4A) uses thereduced alignment error in the following between master grip 230 andslave surgical instrument tip 212T. Conversely, when, the surgeon movesmaster grip 230 in a way that increases the alignment error in thecommon reference frame between master grip 230 and slave surgicalinstrument tip 212T, ratchet alignment process 330A uses the currentalignment error, and not the increased alignment error, in the followingbetween master grip 230 and slave surgical instrument tip 212T.

Thus, ratchet alignment process 330A seamlessly and continuouslyimproves the absolute alignment of master grip 230 with respect to slavesurgical instrument tip 212T. Ratchet alignment process 330A achievesthe continuous improvement in absolute alignment without autonomousmotion of either master grip 230 or slave surgical instrument tip 212T.

If master grip 230 and the slave surgical instrument tip were rigidlyconnected, relative rotation matrix R_(Δ) would be a constant. Inreality, master grip 230 and the slave surgical instrument tip are notrigidly connected, but are coupled through teleoperation servo controlsystem 160. Whenever master grip 230 and the slave surgical instrumenttip are in motion, there is always a small amount of control error. Thiscontrol error can be absorbed using process 330A and alignment obtainedbetween master grip 230 and slave surgical instrument tip 212T.

However, this approach is highly dependent on the stiffness of the servocontrol loop. Under normal conditions in a teleoperatedminimally-invasive surgical system with a stiff servo control loop, theincremental improvements may be too small and thus take a long time toreach satisfactory alignment. Even in such systems, ratcheting system130 is still used, but an introduce control system error controller 560(FIG. 5A) introduces a subtle control error between master griporientation 235 and slave surgical instrument tip orientation 225, inthe common frame of reference, without resulting in autonomous motion ofslave surgical instrument tip.

Techniques for introducing such a subtle control error by introducecontrol system error controller 560 include, but are not limited to:

-   -   1. Penalizing slave angular velocity based on the amount of        rotation angle error θ_(e). This introduces control error by        artificially slowing down motion of the slave based on rotation        angle error θ_(e).    -   2. Imposing artificial joint limits on the motion of slave        surgical instrument tip rotation matrix R_(s), when rotation        angle error θ_(e) is greater than a permissible threshold. This        results in control error between master and slave whenever the        slave reaches an artificial joint limit. The permissible range        of motion for the slave can be gradually widened to the full        range of slave motion as alignment improves.    -   3. Low-pass filtering the sensed master grip rotation matrix        R_(m). This permits control error to be induced and absorb fast        and/or discontinuous motions of master grip 230. The low-pass        filter cutoff may be a function of rotation angle error θ_(e),        such that responsiveness improves as rotation angle error θ_(e)        decreases.    -   4. Low-pass filtering the commanded slave surgical instrument        tip rotation matrix R_(s). This introduces control error between        master grip 230 and slave surgical instrument tip 212T, which        can absorb fast and/or discontinuous orientation commands of        slave surgical instrument tip 212T. The low-pass filter cutoff        may be a function of rotation angle error θ_(e), such that        responsiveness improves as rotation angle error θ_(e) decreases.

FIG. 5A illustrates another implementation of ratchet orientationprocess 330B in ratcheting system 130. Ratchet orientation process 330Buses one of the above techniques or another equivalent technique tointroduce a control system error between the orientations of the slavesurgical instrument tip and the master grip, in the common frame ofreference, via introduce control system error process 510. The otherprocesses 410, 420, 430, 440, 450A and 460A are similar to thecorresponding process described above with respect to FIG. 4A and sothat description is not repeated.

In this example, introduce control system error operation 510 incontroller 560 introduces the control system error after generation ofnew rotation angle error θ_(e-New) in process 410. This location inprocess 330B is illustrative only and is not intended to be limiting tothis specific location in process 330B. Upon selection of a particulartechnique to introduce control system error, introduce control systemerror operation 510 can be placed at an appropriate position withinprocess 330B. Also, an introduce control system error module is includedwithin ratchet orientation module 472 (FIG. 4B) in this example.

In one aspect, operation 510 introduces control error by artificiallyadjusting the commanded angular velocity of the slave surgicalinstrument tip based on current rotation angle error θ_(e-Current). Manydifferent techniques can be used for penalizing the commanded angularvelocity.

In one aspect of operation 510, current rotation angle errorθ_(e-Current) is used in combination with an angular velocity penaltyprofile to generate an angular velocity scale factor for penalizing thecommanded angular velocity of the slave instrument tip. In this aspectthe angular velocity scale factor varies between zero for unacceptablerotation angle errors and one for a rotation angle error of zero.

The angular velocity may be penalized using an angular velocity penaltyprofile which smoothly varies between zero and one as rotation angleerror θ_(e) changes. More generally, any continuous and monotonicangular velocity penalty profile can be used so long as the profile doesnot introduce autonomous motion and does not produce unexpected movementof the slave tip. As used here, continuous means that the firstderivative of the profile exists at any point in the profile.

In one aspect, an angular velocity penalty profile is selected based onthe experience of the surgeon. In another aspect, a single angularvelocity penalty profile is used for all surgeons. In still yet anotheraspect, the angular velocity penalty profile is surgeon specific.

One angular velocity penalty profile suitable for use is a sigmoid shapecurve. FIG. 5B depicts an angular velocity penalty profile 500 that is asigmoid shape curve with two distinct inflection points θ_(e1) andθ_(e2), respectively.

In this example, first inflection point θ_(e1) is placed at 30 degreesand second inflection point θ_(e2) is placed at 90 degrees. Angle θ_(e0)is the angle at which the weight, more specifically referred to as theangular velocity scale factor, is a one, while angle θ_(e3) is the angleat which the weight becomes zero and remains zero for any largermisalignments.

The misalignment angle associated with inflection point θ_(e1) isselected to represent the user tolerance to misalignment, whereas themisalignment angle associated with inflection point θ_(e2) is selectedto represent a maximum usable misalignment angle so that angles largerthan inflection point θ_(e2) are considered unusable alignments.Whenever rotation angle error θ_(e) is greater than inflection pointθ_(e2), the commanded angular velocity of the slave surgical instrumenttip is scaled towards zero, which results in little or no motion of theslave surgical instrument tip. This allows relative rotation matrixR_(Δ) to be readily updated as the operator rotates master grip 230towards slave surgical instrument tip 212T.

As rotation angle error θ_(e) decreases towards inflection point θ_(e1),the commanded angular velocity is gradually increased, allowing for moreresponsive motion of the slave surgical instrument tip while stillinducing enough control error to further improve relative rotationmatrix R_(Δ). Once rotation angle error θ_(e) becomes less thaninflection point θ_(e1), slave surgical instrument tip 212T is perceivedby the surgeon to be well aligned with master grip 230. Therefore, theangular motion of the slave surgical instrument tip 212T is allowed tobe more responsive to the motion of master grip 230. Additional smallalignment corrections continue to be made until relative rotation matrixR_(Δ) becomes the identity matrix and rotation angle error θ_(e) goes tozero.

With respect to artificial joint limits, artificial joint limits onslave motion are defined as a function of the alignment error in thecommon frame of reference, e.g., as a function of rotation angle errorθ_(e). When the alignment error is large, e.g., greater than ninetydegrees, artificial joint limits are imposed on motion of slave surgicalinstrument tip 212T that allow instrument tip 212T to make small motionsabout the current position of instrument tip 212T.

As master grip 230 moves towards slave surgical instrument tip 212T,slave surgical instrument tip 212T moves in the same relative directionuntil an artificial joint limit is encountered. When an artificial jointlimit is encountered, slave surgical instrument tip 212T remains fixedin position at the artificial joint limit. This allows ratcheting system130 to aggressively reduce the alignment error as master grip 230continues to move in the direction of slave surgical instrument tip212T.

In one aspect, the artificial joint limits are gradually widened as thealignment error decreases. This makes the alignment process moreseamless and continuous.

If, for example, low-pass filtering of the sensed master grip rotationmatrix R_(m) is used to introduce a control system error, master griprotation matrix R_(m) changes at a lower frequency. For example, humanscan make controlled motions up to around 20 Hz. The master orientationcan be aggressively filtered down, e.g. to one to five Hertz, to makethe orientation changes more sluggish when alignment is poor. Again, amonotonic penalty profile could be used to move between zero Hertz andtwenty Hertz as a function of the current orientation error.

Conversely, if, for example, low-pass filtering of commanded slavesurgical instrument tip rotation matrix R_(s) is used to introduce acontrol system error, slave surgical instrument tip rotation matrixR_(s) changes at a lower frequency. In view of these examples, oneknowledgeable in the field can select an appropriate low-pass filter sothat the ratcheting seamlessly and continuously improves the absolutealignment of master grip 230 with respect to slave surgical instrumenttip 212T. Ratchet alignment process 330B achieves the continuousimprovement in absolute alignment without autonomous motion of eithermaster grip 230 or slave surgical instrument tip 212T.

In another aspect, method 600 (FIG. 6A) is performed by ratchetingsystem 130. In this aspect, ratcheting system 130 includes a ratchetingsystem module 470A (FIG. 6B). Ratcheting system module 470A includes areceive orientation module 471A and ratchet orientation module 672. Asexplained more completely below, ratchet orientation process 330C (FIG.6A), which is associated with ratchet orientation module 672, penalizesslave angular velocity based on the magnitude of rotation angle errorθ_(e), includes a roll joint limit controller; and determines how asurgeon has grasped master grip 230, e.g., right side up or upside down.

Receive new orientation of master and slave operation 310A, associatedwith receive orientation module 471A, receives master grip orientation235 and slave surgical instrument tip orientation 225. Operation 310Atransfers to check operation 320A.

System following check operation 320A determines whether systemfollowing has been initiated. If system following has not beeninitiated, save master orientation operation 610 saves the receivedmaster orientation in old master orientation storage location 632 inmemory 404A and processing is returned from the ratcheting system. Thus,until following is initiated, the ratcheting system maintains the mostrecent orientation of master grip 230 in the common frame of reference.

When system following is initiated, check operation 320A transfers togenerate new orientation error matrix operation 615, which is associatedwith orientation error generation module 481A (FIG. 6B) in ratchetorientation module 672. Operation 610 uses master grip rotation matrixR_(m) and slave surgical instrument tip rotation matrix R_(s) togenerate a new relative rotation matrix R_(Δ-New) based on definition(1) above. Here, slave surgical instrument tip rotation matrix R_(s) isthe current orientation of slave surgical instrument tip 212T in thecommon frame of reference and is stored for example, in slaveorientation element 131 of memory 404A (FIG. 6B), while master griprotation matrix R_(m) is a new orientation of master grip 230. Uponcompletion, operation 615 transfers to best solution check operation620, which is associated with multiple orientation solution module 681in ratchet orientation module 672.

Best solution check operation 620 determines which of a set of multiplesolutions for the orientation best matches the current orientation ofmaster grip 230 in the common frame of reference. For example, withrespect to the orientation of how the surgeon grasped master grip 230,two possible solutions are considered, right side up and upside down(USD). Thus, in one aspect, check operation 620 is implemented in amultiple orientation solution controller 621 that includes an upsidedown (USD) controller.

Assuming the surgeon used her/his right hand to grasp master grip 230,when the thumb is on lever 231 (FIG. 2A) and the forefinger is on lever232 so that a top of the surgeon's wrist is visible to the surgeon, thisis referred to as right side up. Conversely, when the thumb is on lever232 and the forefinger is on lever 231 so that a bottom of the surgeon'swrist is visible to the surgeon, this is referred to as upside down.Thus, the two solutions for the grasping orientation are 180° apartalong the roll axis. To determine which of the two orientation solutionsto use in process 330C, the cosine of rotation angle error θ_(e) isdetermined for each of the orientations. If the cosine for the upsidedown orientation is larger than the cosine for the right side uporientation, the upside down orientation is set to true and otherwise isset to false.

Thus, using definition (3) above, in one aspect, check operation 620performs the following operations:cos(θ_(e) _(_) s)=[0.5*(R _(Δ11) +R _(Δ22) +R _(Δ33)−1)]cos(θ_(e) _(_) f)=[0.5*(−1*R _(Δ11) −R _(Δ22) +R _(Δ33)−1)]

The orientation in the two dimensions is upside down when cos(θ_(e)_(_)f) is greater than cos (θ_(e) _(_)s) and upside-down orientationflag USD is set to true. Conversely, when cos(θ_(s) _(_)f) is less thanor equal to cos(θ_(e) _(_)s), upside-down orientation flag USD is set tofalse.

Generate new rotation angle error θ_(e) operation 625 and generatecurrent rotation angle error θ_(e) operation 630 are associated withorientation error generation module 481A. Operations 625 and 630generate a new rotation angle error θ_(e-New) and a current rotationangle error θ_(e-Current) using the state of upside down orientationflag USD, a new relative rotation matrix R_(Δ-New), and a currentrelative rotation matrix R_(Δ-Current).

Specifically, if upside-down orientation flag USD is set to true,operation 625 first rotates current relative rotation matrixR_(Δ-Current) in the two dimensions, and then determines currentrotation angle error θ_(e-Current), as explained above. If upside-downorientation flag USD is set to false, operation 625 determines currentrotation angle error θ_(e-Current) without any rotation. Currentrotation angle error θ_(e-Current) is checked and (1) if the value isgreater than pi, current rotation angle error θ_(e-Current) is set topi, or (2) if the value is less than zero, current rotation angle errorθ_(e-Current) is set to zero. Thus, current rotation angle errorθ_(e-Current) is bounded between zero and pi.

Similarly, if upside-down orientation flag USD is set to true, operation630 first rotates new relative rotation matrix R_(Δ-New) in the twodimensions, and then determines new rotation angle error θ_(e-New), asexplained above. If upside-down orientation flag USD is set to false,operation 630 determines new rotation angle error θ_(e-New) without anyrotation. New rotation angle error θ_(e-New) is checked and (1) if thevalue is greater than pi, new rotation angle error θ_(e-New) is set topi, or (2) if the value is less than zero, new rotation angle errorθ_(e-New) is set to zero. Thus, new rotation angle error θ_(e-New) alsois bounded between zero and pi.

Following the determination of the rotation angle errors in operations625 and 630 based on the best solution, a control system error isintroduced in generate penalized angular velocity operation 510A, whichis associated with control system error introduction module 682 inratchet orientation module 672 (FIG. 6B).

In this aspect, operation 510A is implemented in an introduce controlsystem error controller 560A, which in turn is associated with controlsystem error introduction module 682. Penalizing the angular velocity isan example of a one type of control system error that can be introducedby introduce control system error controller 560A. In general, introducecontrol system error controller 560A introduces a control error, such asthose described above.

In this aspect of generate penalized angular velocity operation 510A,the angular velocity is penalized by multiplying the angular velocitysensed from master grip 230 by the angular velocity scale factor frompenalty curve 500 based on current rotation angle error θ_(e-Current),as described above. Following completion of operation 510A, processingtransfers to joint limit control process, which is implemented in aroll-joint limit controller 635. Roll-joint limit controller 635 isassociated with joint limit control module 683 in ratchet orientationmodule 672.

Roll-joint limit controller 635 determines whether a slave surgicalinstrument joint has reached a limit in a given direction and whetherthe sensed motion from master grip 230 is trying to move the slavesurgical instrument tip in that given direction. In this aspect, slaveroll limit check operation 640, in roll-joint limit controller 635,determines whether the roll joint in the slave surgical instrument hasreached a roll limit, and if the sensed motion from master grip 230 istrying to rotate slave surgical instrument tip 212T in that rolldirection.

In check operation 640, the upper and lower roll limits are predefined.Old master grip rotation matrix R_(m-old), which was stored in oldmaster orientation location 632, is transposed. A relative master griprotation matrix R_(mΔ) is defined as:R _(mΔ) =R _(m-old) ^(T) *R _(m)Thus, relative master grip rotation matrix R_(mΔ) is a three-by-threematrix:

$R_{m\;\Delta} = \begin{pmatrix}R_{m\;\Delta\; 11} & R_{m\;\Delta\; 12} & R_{m\;\Delta\; 13} \\R_{m\;\Delta\; 21} & R_{m\;\Delta\; 22} & R_{m\;\Delta\; 23} \\R_{m\;\Delta\; 31} & R_{m\;\Delta\; 32} & R_{m\;\Delta\; 33}\end{pmatrix}$

The master grip roll direction is defined as:Master_roll_dir=[R _(Δ21) −R _(Δ12)].Next, check operation 640 determines first whether the position of slavesurgical instrument tip 212T is less than the lower roll joint limitplus a tolerance and master roll direction Master_roll_dir is less thanzero. If the result of this first determination is true, the lower rolljoint limit has been reached and the direction of the master griprotation is in the direction of that lower roll limit. Thus, the slavesurgical instrument tip motion is constrained.

If the result of this first determination is false, check operation 640determines second whether the position of the slave surgical instrumenttip is greater than the upper roll joint limit minus a tolerance andmaster roll direction Master_roll_dir is greater than zero. If theresult of this second determination is true, the upper roll joint limithas been reached and the direction of the master grip rotation is in thedirection of that upper roll limit. Thus, the slave surgical instrumentmotion is constrained.

When the slave surgical instrument motion is constrained, slave rolllimit check operation 640 transfers to set current rotation angle errorand angular velocity operation 645, and otherwise to rotation angleerror reduced check operation 420A. Set current rotation angle error andangular velocity operation 645 sets current rotation angle errorθ_(e-Current) to a value larger than any possible physical value, andsets the commanded angular velocity to zero. Set current rotation angleerror and angular velocity operation 645 transfers processing toorientation error reduced check operation 420A.

Orientation error reduced check operation 420A determines whether newrotation angle error θ_(e-New) is less than current rotation angle errorθ_(e-Current), e.g., check operation 420 is implemented as a comparator.If new rotation angle error θ_(e-New) is equal to or greater thancurrent rotation angle error θ_(e-Current), check operation 420A passesto save master orientation operation 650. Conversely, if new rotationangle error θ_(e-New) is less than current rotation angle errorθ_(e-Current), check operation 420A passes processing to set orientationerror operation 430A.

Set orientation error operation 430A, which is associated withcomparator module 482A, sets current rotation angle error θ_(e-Current)to new rotation angle error θ_(e-New). Operation 430A also sets currentrelative rotation matrix R_(Δ-Current) to new relative rotation matrixR_(Δ-New) and then transfers to save master orientation operation 650,which saves master grip rotation matrix R_(m). in element 632 (FIG. 6B).Operation 650 transfers processing to generate new slave orientationoperation 450B (FIG. 6A).

Generate new slave orientation 450B, which is associated with slavegeneration orientation module 483A (FIG. 6B), first generates atranspose matrix R_(Δ) ^(T) of current relative rotation matrixR_(Δ-Current). Next, a new slave orientation matrix R_(s) is obtained bycombining transpose matrix R_(Δ) ^(T) and master grip rotation matrixR_(m) according to definition (2), above.

Generate new slave orientation 450B transfers processing to send slaveorientation command operation 460B (FIG. 6A), which is associated withslave command generation module 484A. Using new slave orientation R_(s),operation 460 sends a command including the slave orientation and thecommanded angular velocity, in the common frame of reference, via slaveinput/output (I/O) module 403, which results in slave surgicalinstrument tip 212T being moved as directed by that command. Themovement depends upon which relative rotation matrix R_(Δ) was used inthe current iteration of process 330C and the commanded angularvelocity.

When the surgeon moves master grip 230 in a way that reduces thealignment error between master grip 230 and slave surgical instrumenttip 212T, e.g., reduces rotation angle error θ_(e), ratchet alignmentprocess 330C (FIG. 6A) uses the reduced alignment error in the followingbetween master grip 230 and slave surgical instrument tip 212T whileaccounting for how the surgeon grasped master grip 230 and whether aroll joint limit was encountered. Conversely, when the surgeon movesmaster grip 230 in a way that increases the alignment error betweenmaster grip 230 and slave surgical instrument tip 212T, ratchetalignment process 330C uses the current alignment error, and not theincreased alignment error, in the following between master grip 230 andslave surgical instrument tip 212T.

Thus, ratchet alignment process 330C seamlessly and continuouslyimproves the absolute alignment of master grip 230 with respect to slavesurgical instrument tip 212T. Ratchet alignment process 330C achievesthe continuous improvement in absolute alignment without autonomousmotion of either master grip 230 or slave surgical instrument tip 212T.

In method 600, roll-joint limit controller 635 was used to handle acorner-case for a slave range of motion. This corner-case is consideredfurther with respect to FIG. 7. FIG. 7 illustrates a technique forintroducing corner-case joint limits. In this example, there is a rolljoint limit at zero degrees and another roll joint limit at onehundred-eighty degrees. Thus, when master grip 230 is at zero degrees,slave surgical instrument tip is positioned as shown by slave surgicalinstrument tip 790; at ninety degree, slave surgical instrument tip ispositioned as shown by slave surgical instrument tip 791; and at onehundred-eighty degrees, slave surgical instrument tip is positioned asshown by slave surgical instrument tip 792.

If the surgeon continued to rotate master grip 230 in the counterclockwise direction back to zero degrees, slave tip 792 suddenly mightmove to the orientation of slave tip 790, e.g., there would beautonomous motion. However, with corner-case joint limits on the motionof the slave surgical instrument tip such motion is inhibited. Forexample, when the orientation of master grip 230 comes within apredetermined tolerance of a joint limit, the commanded angular velocityof the slave surgical instrument tip is set to zero and current rotationangle error θ_(e-Current) is set to an artificially large number so thatnew relative rotation matrix R_(Δ-New) is used. This essentially allowsthe master orientation to slip relative to the orientation of the slavesurgical instrument tip when the slave surgical instrument tip is at aroll limit.

With a conventional powered master, the user would receive forcefeedback to indicate when a slave has reached a range of motion limit.With an unpowered master, a roll-joint limit controller, in theratcheting system, can be used to maintain continuity of slave motion asthe master drives the slave in and out of a joint limit.

In the above methods, various modules and operations and/or processesassociated with those modules were described. The modules may beimplemented in hardware, software that is executed on a processor,firmware or any combination of hardware, software or firmware.

When the modules include one or more instructions stored on a storagemedium, the described operations and/or processes are the result ofretrieval and execution of the one or more instructions on at least oneprocessor in processor module 401 to obtain the transformationdescribed. The particular modules described are illustrative only andare not intended to be limiting. In view of the disclosure, oneknowledgeable in the field can combine modules together or separate amodule into one or more additional modules as may be desired. Moreoverwhile the modules are shown grouped in a common location this also isillustrative only.

TABLE 1 is an example of software instructions written in theC-programming language that when executed on a processor performelements 302A, 610, 615, 620, 621, 625, 630, 510A, 560A, 635, 640, 645,420A, 430A and 650.

TABLE 1 #define CLAMP(val,lo,hi)  (MIN(MAX((val),(lo)),(hi))) typedefFLOAT (*Matrix3×3Ptr)[3];/********************************************************/ static FLOATpsm_io_rotation_angle(const Matrix3×3Ptr R,               BOOLEAN USD) {  float traceR;   float costheta;   /* Account for USD configuration byapplying   rotation of 180 degrees Z */   if (USD)   {     FLOATRtmp[3][3];     static const FLOAT Rroll[3][3] =     {       { −1, 0, 0},       { 0, −1, 0 },       { 0, 0, 1 }     };    Matrix_multiplyMatrixf(Rtmp, /* = */ R, 3, 3,               /* x */Rroll, 3, 3);     traceR = Rtmp[0][0] + Rtmp[1][1] + Rtmp[2][2];   }  else   {     traceR = R[0][0] + R[1][1]+ R[2][2];   }   costheta =0.5f * (traceR − 1.0f);   if (costheta > 1.0)   {     return 0.0;   }  else if (costheta < −1.0)   {     return M_PI;   }   else   {    return (FLOAT) acos(costheta);   } }/********************************************************/ INTpsm_io_constrain_master_roll   (const Matrix3×3Ptr Rm_old, constMatrix3×3Ptr Rm) {   static const FLOAT tolerance = 1.0f * M_PI / 180.0;  FLOAT* const pos = Ptr(SYS_HW_JNTPOS, 0,            PSM_JNT_POS_DOFS);   float_par* lower =Ptr(PC_JI_IK_POSLOWERLIMIT, 0,             PSM_JNT_POS_DOFS);  float_par* upper = Ptr(PC_JI_IK_POSUPPERLIMIT, 0,            PSM_JNT_POS_DOFS);   FLOAT Rm_old_trans[3][3];   FLOATRm_delta[3][3];   FLOAT mtm_roll_dir;   INT constrain_roll = 0;  //Compute the error, rotation as R2 w.r.t. R1.  Matrix_transposef(Rm_old_trans, Rm_old, 3, 3);   /* Rm_delta =Rm_old_trans' * Rm */   Matrix_multiplyMatrixf(Rm_delta,              /*= */ Rm_old_trans, 3, 3,              /* x */ Rm, 3, 3);   //Define thelocal error vector w.r.t. R1.   mtm_roll_dir =Scalar_fsignf(Rm_delta[1][0] −                Rm_delta[0][1]);   //Checkif the PSM roll joint has reached a limit and   //if the MTM is tryingto rotate in that roll   //direction   if (pos[PSM_RO] <(lower[PSM_RO] + tolerance)     && mtm_roll_dir < 0)   {    constrain_roll = 1;   }   else if (pos[PSM_RO] > (upper[PSM_RO] −tolerance)       && mtm_roll_dir > 0)   {     constrain_roll = 1;   }  return constrain_roll; }/********************************************************/ // Parametersused by sigmoid-shaped velocity weight // function #define SIGMOID_ALPHA5.0f #define SIGMOID_BETA (0.3f*M_PI)/************************************************* *psm_io_ratchet_offset( ) * * Conditionally updates the orientationoffset * * to improve the alignment between MTM and PSM ***************************************************/ voidpsm_io_ratchet_offset(const Matrix3×3Ptr Rm,           Matrix3×3PtrRoff, FLOAT *rotvel) {   static FLOAT Rm_old[3][3];   FLOATRs_trans[3][3];   FLOAT Roff_new[3][3];   FLOAT cur_offset;   FLOATnew_offset;   FLOAT cosangle_s, cosangle_f;   FLOAT vel_weight;  BOOLEAN USD = FALSE;   Matrix3×3Ptr Rs = (Matrix3×3Ptr)Ptr(SYS_IO_OUT_CART,                         3, 9);   if(Kernel_RobustBooleanIsFALSE              (PSM_IO_FOLLOW_DATA_VALID))  {     Matrix_copyf(Rm_old, Rm, 3, 3);     return;   }   /* Update therelative rotation offset Roff between   master and slave, if the currentoffset is smaller */   Matrix_transposef(Rs_trans, Rs, 3, 3);   //Compute the offset between the new MTM and new PSM   /* Roff_new = Rs' *Rm */   Matrix_multiplyMatrixf(Roff_new, /* = */ Rs_trans,             3, 3, /* x */ Rm, 3, 3); // Determine whether to use thestraight or // upside-down solution cosangle_s = (FLOAT)(0.5 *(Roff_new[0][0] +       Roff_new[1][1] + Roff_new[2][2] − 1));cosangle_f = (FLOAT)(0.5 * (−1 * Roff_new[0][0] −       Roff_new[1][1] +Roff_new[2][2] − 1)); USD = (cosangle_f > cosangle_s) ? TRUE : FALSE;new_offset = psm_io_rotation_angle(Roff_new, USD); cur_offset =psm_io_rotation_angle(Roff, USD); /* Reduce the angular velocity basedon the current  * amount of misalignment. We are using a sigmoid  *function as the weight, since it provides a smooth  * transition betweenfull velocity and no velocity.  * The curve has been tuned to falloffnear 30  * degrees and bottom out around 90 degrees */ vel_weight =1.0f/(1.0f + exp(SIGMOID_ALPHA*         (cur_offset−SIGMOID_BETA)));vel_weight = CLAMP(vel_weight, 0.0f, 1.0f); vector_scalef(rotvel,rotvel, vel_weight,             CART_ORI_DOFS); /* Constrain the MTMcommand if the PSM has hit a roll limit */ if(psm_io_constrain_master_roll(Rm_old, Rm)) {   cur_offset = BIG_NUM;  vector_setf(rotvel, 0, CART_ORI_DOFS); } /* Conditionally update theRoff offset if we've found a smaller relative rotation*/ if (new_offset< cur_offset) {   Matrix_copyf(Roff, Roff_new, 3, 3);   }   // Save themost recent Rm   Matrix_copyf(Rm_old, Rm, 3, 3); }

In the examples of FIGS. 2B, 4A, 4B, 5A, 5B, 6A and 6B, a scalarquantity was used to determine the ratcheting of the orientation inthree-dimensions in a common frame of reference. However, in anotheraspect, the scalar quantity can be associated with a single dimension ina common frame of reference. For example, instead of using scalarrotation angle error θ_(e) to specify the orientation error for threedimensions, relative rotation matrix R_(Δ) can be decomposed in a set ofEuler angles α, β, and γ (FIG. 2C). Line N represents the intersectionof the two X-Y planes. In this instance, the ratcheting of processes330, 330A, 330B, or 330C could be performed with respect to one of theEuler angles, e.g., Euler angle β, or the alignment error may beoptimized by sequentially or concurrently ratcheting each of the Eulerangles, or some subset of the set of Euler angles. For example, someminimally-invasive surgical instruments could be constrained orimplemented such that the orientation with respect to one of the Eulerangles is of interest and so the ratcheting of the orientation would bedone with respect to that Euler angle.

The above description and the accompanying drawings that illustrateaspects and embodiments of the present inventions should not be taken aslimiting—the claims define the protected inventions. Various mechanical,compositional, structural, electrical, and operational changes may bemade without departing from the spirit and scope of this description andthe claims. In some instances, well-known circuits, structures, andtechniques have not been shown or described in detail to avoid obscuringthe invention.

Further, this description's terminology is not intended to limit theinvention. For example, spatially relative terms—such as “beneath”,“below”, “lower”, “above”, “upper”, “proximal”, “distal”, and thelike—may be used to describe one element's or feature's relationship toanother element or feature as illustrated in the figures. Thesespatially relative terms are intended to encompass different positionsand orientations of the device in use or operation in addition to theposition and orientation shown in the figures. For example, if thedevice in the figures is turned over, elements described as “below” or“beneath” other elements or features would then be “above” or “over” theother elements or features. Thus, the exemplary term “below” canencompass both positions and orientations of above and below. The devicemay be otherwise oriented (rotated 90 degrees or at other orientations)and the spatially relative descriptors used herein interpretedaccordingly.

The singular forms “a”, “an”, and “the” are intended to include theplural forms as well, unless the context indicates otherwise. The terms“comprises”, “comprising”, “includes”, and the like specify the presenceof stated features, steps, operations, elements, and/or components butdo not preclude the presence or addition of one or more other features,steps, operations, elements, components, and/or groups.

All examples and illustrative references are non-limiting and should notbe used to limit the claims to specific implementations and embodimentsdescribed herein and their equivalents. The headings are solely forformatting and should not be used to limit the subject matter in anyway, because text under one heading may cross reference or apply to textunder one or more headings. Finally, in view of this disclosure,particular features described in relation to one aspect or embodimentmay be applied to other disclosed aspects or embodiments of theinvention, even though not specifically shown in the drawings ordescribed in the text.

While the memory is illustrated as a unified structure, this should notbe interpreted as requiring that all memory is at the same physicallocation. All or part of the memory can be in a different physicallocation than a processor. Memory refers to a volatile memory, anon-volatile memory, or any combination of the two.

A processor is coupled to a memory containing instructions executed bythe processor. This could be accomplished within a computer system, oralternatively via a connection to another computer via modems and analoglines, or digital interfaces and a digital carrier line.

Herein, a computer program product comprises a medium configured tostore computer readable code needed for any one or any combination ofmethods 300, 330, 330A, 330B, 600, 330C or in which computer readablecode for any one or any combination of methods 300, 330, 330A, 330B,600, 330C is stored. Some examples of computer program products areCD-ROM discs, DVD discs, flash memory, ROM cards, floppy discs, magnetictapes, computer hard drives, servers on a network and signalstransmitted over a network representing computer readable program code.A tangible computer program product comprises a medium configured tostore computer readable instructions for any one of, or any combinationof methods 300, 330, 330A, 330B, 600, 330C or in which computer readableinstructions for any one of, or any combination of methods 300, 330,330A, 330B, 600, 330C is stored. Tangible computer program products areCD-ROM discs, DVD discs, flash memory, ROM cards, floppy discs, magnetictapes, computer hard drives and other physical storage mediums.

In view of this disclosure, instructions used in any one of, or anycombination of methods 300, 330, 330A, 330B, 600, 330C can beimplemented in a wide variety of computer system configurations using anoperating system and computer programming language of interest to theuser.

Further, various different minimally-invasive systems and methods can beimplemented in view of this disclosure.

In one a aspect, a minimally-invasive surgical system comprises:

-   -   a slave surgical instrument having a slave surgical instrument        tip wherein the slave surgical instrument tip has an alignment        in a common coordinate frame of reference;    -   a master grip, coupled to the slave surgical instrument, having        an alignment in the common coordinate frame of reference,        -   wherein an alignment error in the common frame of reference            is a difference in alignment in the common frame of            reference between the alignment of the slave surgical            instrument tip and the alignment of the master grip; and    -   a ratcheting system, (i) coupled to the master grip to receive        the alignment of the master grip and (ii) coupled to the slave        surgical instrument, to control motion of the slave by        continuously reducing the alignment error, as the master grip        moves, without autonomous motion of the slave surgical        instrument tip and without autonomous motion of the master grip.

The ratcheting system further includes an introduce control system errorcontroller for introducing a control system error with respect to thealignments of the slave surgical instrument tip and the master grip.

The introduce control system error controller includes, but is notlimited to, any one of or any combination of:

-   -   1. Penalizing slave angular velocity based on the amount of        rotation angle error;    -   2. Imposing artificial joint limits on the motion of slave        surgical instrument tip based on a rotation angle error.    -   3. Low-pass filtering the sensed master grip rotation; and    -   4. Low-pass filtering the commanded slave surgical instrument        tip rotation.

In another aspect, the ratcheting system includes a multiple orientationsolution controller for determining an orientation solution closest toan orientation of the master grip. The multiple orientation controllercan be included in any combination of controllers, including but notlimited to the introduce control system error controller. In one aspect,the multiple orientation solution controller includes an upside downcontroller.

In another aspect, a method for controlling alignment of a slavesurgical instrument tip in a minimally-invasive surgical system withalignment of a master grip in the minimally-invasive surgical systemcomprises:

-   -   receiving, by a ratcheting system in the minimally-invasive        surgical system, an alignment of the slave surgical instrument        tip in a common frame of reference and an alignment of the        master grip in the common frame of reference; and    -   ratcheting, by the ratcheting system, the alignment of the slave        surgical instrument tip to the alignment of the master grip by        continuously reducing an alignment error in the common frame of        reference between the alignments, as the master grip moves,        without autonomous motion of the slave surgical instrument tip        and without autonomous motion of the master grip.

In one aspect, the ratcheting further comprises:

introducing a control system error between the slave surgical instrumenttip alignment and the master grip alignment.

The introducing a control system error includes, but is not limited to,any one of or any combination of:

-   -   1. Penalizing slave angular velocity based on the amount of        rotation angle error;    -   2. Imposing artificial joint limits on the motion of slave        surgical instrument tip based on a rotation angle error.    -   3. Low-pass filtering the sensed master grip rotation; and    -   4. Low-pass filtering the commanded slave surgical instrument        tip rotation.

In still another aspect, the ratcheting further comprises selecting anorientation solution from a group of orientation solutions based on anorientation, in the common frame of reference, of the master grip. Inone aspect, the selecting an orientation solution is in combination withthe introducing a control system error. In another aspect, the selectingan orientation solution includes selecting an upside down solution.

We claim:
 1. A method comprising: characterizing, by a ratcheting systemin a surgical system, a first alignment error that is a differencebetween a first alignment of a master grip of the surgical system and afirst alignment of a slave surgical instrument tip of a slave surgicalinstrument of the surgical system; determining, by the ratchetingsystem, a new alignment error that is a difference between a secondalignment of the master grip and the first alignment of the slavesurgical instrument tip; and using, by the ratcheting system, the newalignment error to control motion of the surgical instrument tip only ifthe new alignment error is smaller than the first alignment error. 2.The method of claim 1: wherein the first alignment error comprises afirst orientation error: and wherein the new alignment error comprises anew orientation error.
 3. The method of claim 2, wherein the firstorientation error comprises an angle.
 4. The method of claim 3: whereinthe angle (θ_(e)) is expressed as:θ_(e)=cos⁻¹[0.5*(R _(Δ11) +R _(Δ22) +R _(Δ33)−1)], and wherein R_(Δ11),R_(Δ22), R_(Δ33) are diagonal elements of a relative rotation matrixR_(Δ-first).
 5. The method of claim 3, wherein the angle is one Eulerangle in a set of Euler angles.
 6. The method of claim 2, wherein thenew orientation error comprises an angle.
 7. The method of claim 6:wherein the angle (θ_(e)) is expressed as:θ_(e)=cos⁻¹[0.5*(R _(Δ11) +R _(Δ22) +R _(Δ33)−1)], and wherein R_(Δ11),R_(Δ22), R_(Δ33) are diagonal elements of a relative rotation matrixR_(Δ-new).
 8. The method of claim 6, wherein the angle is one Eulerangle in a set of Euler angles.
 9. The method of claim 1, furthercomprising: constraining, by the ratcheting system, roll motion of theslave surgical instrument tip if a joint limit is reached during motionof the slave surgical instrument tip.
 10. The method of claim 1, furthercomprising: introducing, by the ratcheting system, a control systemerror in the new alignment error to speed up convergence of alignmentbetween the slave surgical instrument tip and the master grip.
 11. Themethod of claim 1, further comprising: determining, by the ratchetingsystem, a first orientation solution closest to an orientation of themaster grip from multiple orientation solutions; and using the firstorientation solution to determine the new alignment error.
 12. Themethod of claim 1, the master grip comprising an unpowered master grip.13. The method of claim 1, further comprising: performing thedetermining and the using the new alignment error while the master gripis used to control the slave surgical instrument tip.